#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;
int main()
{
    const int row = 10;
    int i, j;
    int triangle[row][row];
    for (i = 0; i < row; i++)
        for (j = 0; j <= i; j++)
        {
            if (j == 0 || j == i)
                triangle[i][j] = 1;
            else
                triangle[i][j] = triangle[i - 1][j - 1] + triangle[i - 1][j];
        }
    for (i = 0; i < row; i++)
    {
        for (j = 0; j <= i; j++)
        {
            cout << triangle[i][j] << "\t";
        }
        cout << endl;
    }
    return 0;
}